Configure Calculated Attribute: Settings

The Settings tab allows you to configure high-level properties for a Calculated Attribute, such as refresh behavior, caching rules, and conditions for population.

To configure the settings of the Calculated Attribute:

  1. Navigate to the Settings tab of the Member Attribute Details screen.

  2. Check Read-only. This setting is required for Calculated Attributes.

  3. Within the Calculated Attribute Settings section, optionally check one or both of the following refresh triggers: Activity is Processed and API Requests Calculation. These options both refer to the On-demand computation mode, and specify what events can cause the platform to refresh the Calculated Attribute.

Note: Calculated Attributes can always be refreshed by a Scheduled Job in addition to one or both of the above options.

  1. In the TTL (Time-to-Live) field, enter the number of seconds that the calculated value remains valid before being re-calculated (applicable to API requests only).

When a Calculated Attribute is accessed by an API request, the platform checks whether its value is still within the defined TTL range. If the value is within the TTL range, the platform uses the existing cached value. If the value is beyond the TTL range, the platform recalculates it.

When determining the TTL value for your Calculated Attribute, consider the type of data stored in this field, and how it will be used. If you make the TTL value too short, you potentially impact performance by unnecessarily recalculating a value when you may not need to. Conversely, if you make the TTL value too long, you risk using outdated or "stale" data. Generally speaking, you must determine a TTL value that strikes a balance between performance and timeliness. 

The Condition section allows you to optionally apply a logical condition that identifies which records need to have this Calculated Attribute populated. To define a condition:

  1. Click the Add icon, then select Add Rule. The platform adds a new blank row. 

  1. The first drop-down menu is populated with all of the different object types in Loyalty that are available for use. From this drop-down menu, select one of the following object types to expand it and see the available options:

 

  1. Repeat the above steps as needed to define more Rules. Optionally, to remove a Rule, click the Remove icon next to it.

  2. Once you define more than one Rule, select the logical operator from the Include customers that meet drop-down menu: 

    • All of the following: Use an 'AND' operator such that all Rules must be true for a record to be selected. 

    • Some of the following: Use an 'OR' operator such that at least one of the Rules must be true for a record to be selected.

  3. Optionally, you can also organize Rules into Rule Groups. A Rule Group allows you to build more complex selection criteria. To create a Rule Group, click the Add icon, then select Add Rule Group. The platform creates a Group, which is represented visually as a nested box with its own operator and Add icon. Within this Group box, click the Add icon to define the Rule (or Rules) using the same process as described above. Use the toggle within the Group box to define the logical operator for the Rules within the Group.

Note: By clicking the Group button inside the Group box, you can create "nested" groups.

  1. Click Save.